# coding=utf8

# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# NOTE: This class is auto generated by the jdcloud code generator program.

from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest


class ModifyReplicationRequest(JDCloudRequest):
    """
    修改复制任务，修改前需要先暂停复制任务。为保证复制任务的可靠性，目前仅允许修改部分配置。
    """

    def __init__(self, parameters, header=None, version="v1"):
        super(ModifyReplicationRequest, self).__init__(
            '/regions/{regionId}/instances/{instanceId}/replications/{taskId}:modifyReplication', 'POST', header, version)
        self.parameters = parameters


class ModifyReplicationParameters(object):

    def __init__(self,regionId, instanceId, taskId, ):
        """
        :param regionId: 地域代码
        :param instanceId: 实例ID
        :param taskId: 复制任务ID
        """

        self.regionId = regionId
        self.instanceId = instanceId
        self.taskId = taskId
        self.targetComment = None
        self.targetUser = None
        self.targetPassword = None
        self.kafkaTopic = None
        self.kafkaVersion = None
        self.replicationObjects = None

    def setTargetComment(self, targetComment):
        """
        :param targetComment: (Optional) 目标实例备注说明
        """
        self.targetComment = targetComment

    def setTargetUser(self, targetUser):
        """
        :param targetUser: (Optional) 目标类型为TiDB或MySQL时，连接目标实例的用户名
        """
        self.targetUser = targetUser

    def setTargetPassword(self, targetPassword):
        """
        :param targetPassword: (Optional) 目标类型为TiDB或MySQL时，连接目标实例的密码
        """
        self.targetPassword = targetPassword

    def setKafkaTopic(self, kafkaTopic):
        """
        :param kafkaTopic: (Optional) Kafka的Topic
        """
        self.kafkaTopic = kafkaTopic

    def setKafkaVersion(self, kafkaVersion):
        """
        :param kafkaVersion: (Optional) Kafka的版本
        """
        self.kafkaVersion = kafkaVersion

    def setReplicationObjects(self, replicationObjects):
        """
        :param replicationObjects: (Optional) 过滤规则列表
        """
        self.replicationObjects = replicationObjects

